package features.advance.quartz.listeners;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobListener;

/**
 * @author LIN
 * @date 2022-06-05 17:11
 */
public class MyJobListener implements JobListener {

    @Override
    public String getName() {
        return "myJobListener";
    }

    @Override
    public void jobToBeExecuted(JobExecutionContext context) {
        System.out.println(context.getJobDetail().getKey()+"job将要执行");
    }

    @Override
    public void jobExecutionVetoed(JobExecutionContext context) {
        System.out.println(context.getJobDetail().getKey()+"job执行中，被否决");
    }

    @Override
    public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
        System.out.println(context.getJobDetail().getKey()+"job执行完毕");
    }
}
